home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 123
/
(Vol 123) Jan 13 2011.iso
/
Games
/
spaceman_bobs_great_escape.swf
/
scripts
/
frame_102
/
DoAction.as
Wrap
Text File
|
2011-01-13
|
33KB
|
928 lines
function buildMap(map)
{
_root.attachMovie("empty","tiles",1);
_root.tiles._x = 15;
_root.tiles._y = 0;
game.clip = _root.tiles;
var mapWidth = map[0].length;
var mapHeight = map.length;
var i = 0;
while(i < mapHeight)
{
var j = 0;
while(j < mapWidth)
{
var name = "t_" + i + "_" + j;
game[name] = new game["Tile" + map[i][j]]();
game.clip.attachMovie("tile",name,i * 100 + j * 2);
game.clip[name]._x = j * game.tileW;
game.clip[name]._y = i * game.tileH;
game.clip[name].gotoAndStop(game[name].frame);
if(game[name].item != undefined)
{
game.clip[name].attachMovie(game[name].item,"item",1);
}
j++;
}
i++;
}
var enemies = myEnemies[game.currentMap];
game.currentEnemies = enemies.length;
var i = 0;
while(i < game.currentEnemies)
{
var name = "enemy" + i;
game[name] = new game["Enemyp" + enemies[i][0]]();
game.clip.attachMovie("enemy" + enemies[i][0],name,11001 + i);
game[name].clip = game.clip[name];
game[name].xtile = enemies[i][1];
game[name].ytile = enemies[i][2];
game[name].width = game.clip[name]._width / 2;
game[name].height = game.clip[name]._height / 2;
game[name].x = game[name].xtile * game.tileW + game.tileW / 2;
game[name].y = game[name].ytile * game.tileH + game.tileH / 2;
game[name].clip._x = game[name].x;
game[name].clip._y = game[name].y;
i++;
}
game.items = myItems[game.currentMap];
var i = 0;
while(i < game.items.length)
{
var name = "item" + game.items[i][2] + "_" + game.items[i][1];
game[name] = new game["Item" + game.items[i][0]]();
game[name].position = i;
game.clip.attachMovie("items",name,12001 + i);
game[name].clip = game.clip[name];
game[name].clip._x = game.items[i][1] * game.tileW + game.tileW / 2;
game[name].clip._y = game.items[i][2] * game.tileH + game.tileH / 2;
game[name].clip.gotoAndStop(game.items[i][0]);
i++;
}
_root.points = game.points;
game.movingtiles = myMovingTiles[game.currentMap];
var i = 0;
while(i < game.movingtiles.length)
{
var name = "movingtile" + i;
game[name] = new game["MovingTilep" + game.movingtiles[i][0]]();
game.clip.attachMovie("movingtiles",name,13001 + i);
game[name].clip = game.clip[name];
game[name].clip.gotoAndStop(game.movingtiles[i][0]);
game[name].xtile = game.movingtiles[i][1];
game[name].ytile = game.movingtiles[i][2];
game[name].x = game[name].xtile * game.tileW + game.tileW / 2;
game[name].y = game[name].ytile * game.tileH + game.tileH / 2;
game[name].clip._x = game[name].x;
game[name].clip._y = game[name].y;
game[name].minx += game[name].xtile;
game[name].maxx += game[name].xtile;
game[name].miny += game[name].ytile;
game[name].maxy += game[name].ytile;
i++;
}
game.clip.attachMovie("char","char",10000);
char.clip = game.clip.char;
char.width = char.clip._width / 2;
char.height = char.clip._height / 2;
char.x = char.xtile * game.tileW + game.tileW / 2;
char.y = (char.ytile + 1) * game.tileW - char.height;
char.clip._x = char.x;
char.clip._y = char.y;
char.clip.gotoAndStop(char.frame);
}
function changeMap(ob)
{
var tempitems = [];
var i = 0;
while(i < game.items.length)
{
if(game.items[i])
{
var name = "item" + game.items[i][2] + "_" + game.items[i][1];
delete game[name];
tempitems.push(game.items[i]);
}
i++;
}
myItems[game.currentMap] = tempitems;
var name = "t_" + ob.ytile + "_" + ob.xtile;
game.currentMap = game[name].newMap;
ob.ytile = game[name].newchary;
ob.xtile = game[name].newcharx;
ob.frame = ob.clip._currentframe;
buildMap(_root["myMap" + game.currentMap]);
_root.bana = _root.game.currentMap;
}
function getMyCorners(x, y, ob)
{
ob.downY = Math.floor((y + ob.height - 1) / game.tileH);
ob.upY = Math.floor((y - ob.height) / game.tileH);
ob.leftX = Math.floor((x - ob.width) / game.tileW);
ob.rightX = Math.floor((x + ob.width - 1) / game.tileW);
ob.upleft = game["t_" + ob.upY + "_" + ob.leftX].walkable;
ob.downleft = game["t_" + ob.downY + "_" + ob.leftX].walkable;
ob.upright = game["t_" + ob.upY + "_" + ob.rightX].walkable;
ob.downright = game["t_" + ob.downY + "_" + ob.rightX].walkable;
}
function checkIfOnCloud(ob)
{
var leftcloud = game["t_" + ob.downY + "_" + ob.leftX].cloud;
var rightcloud = game["t_" + ob.downY + "_" + ob.rightX].cloud;
if((leftcloud or rightcloud) and ob.ytile != ob.downY)
{
return true;
}
return false;
}
function enemyBrain()
{
var i = 0;
while(i < game.currentEnemies)
{
var name = "enemy" + i;
var ob = game[name];
getMyCorners(ob.x + ob.speed * ob.xMove,ob.y + ob.speed * ob.yMove,ob);
if(ob.downleft and ob.upleft and ob.downright and ob.upright)
{
moveChar(ob,ob.xMove,ob.yMove);
}
else
{
ob.xMove = - ob.xMove;
ob.yMove = - ob.yMove;
}
var xdist = ob.x - char.x;
var ydist = ob.y - char.y;
if(Math.sqrt(xdist * xdist + ydist * ydist) < ob.width + char.width)
{
if(0 < liv)
{
_root.liv = liv - 1;
char.clip.gotoAndStop(9);
if(soundfx == 1)
{
hurt.start();
}
}
}
i++;
}
}
function moveChar(ob, dirx, diry, jump)
{
if(Math.abs(jump) == 1)
{
speed = ob.jumpspeed * jump;
}
else
{
speed = ob.speed;
}
ob.lasty = ob.y;
getMyCorners(ob.x,ob.y + speed * diry,ob);
if(diry == -1)
{
if(ob.upleft and ob.upright)
{
ob.y += speed * diry;
}
else
{
ob.y = ob.ytile * game.tileH + ob.height;
ob.jumpspeed = 0;
}
}
if(diry == 1)
{
if(ob.downleft and ob.downright and !checkIfOnCloud(ob) and !checkMovingTiles(speed * diry))
{
ob.y += speed * diry;
}
else
{
ob.jump = false;
if(ob.onMovingTile)
{
ob.y = ob.onMovingTile.y - ob.onMovingTile.height - ob.height;
}
else
{
ob.y = (ob.ytile + 1) * game.tileH - ob.height;
}
}
}
getMyCorners(ob.x + speed * dirx,ob.y,ob);
if(dirx == -1)
{
if(ob.downleft and ob.upleft)
{
ob.climb = true;
ob.x += speed * dirx;
fall(ob);
}
else
{
ob.x = ob.xtile * game.tileW + ob.width;
}
}
if(dirx == 1)
{
if(ob.upright and ob.downright)
{
ob.climb = true;
ob.x += speed * dirx;
fall(ob);
}
else
{
ob.x = (ob.xtile + 1) * game.tileW - ob.width;
}
}
var itemname = game["item" + ob.ytile + "_" + ob.xtile];
if(itemname and ob == _root.char)
{
game.points += itemname.points;
_root.points = game.points;
if(soundfx == 1)
{
point.start();
}
removeMovieClip(itemname.clip);
game.items[itemname.position] = 0;
delete game["item" + ob.ytile + "_" + ob.xtile];
}
updateChar(ob,dirx,diry);
return true;
}
function updateChar(ob, dirx, diry)
{
ob.clip._x = ob.x;
ob.clip._y = ob.y;
ob.xtile = Math.floor(ob.clip._x / game.tileW);
ob.ytile = Math.floor(ob.clip._y / game.tileH);
if(game["t_" + ob.ytile + "_" + ob.xtile].door and ob == _root.char)
{
changeMap(ob);
}
}
function jump(ob)
{
ob.jumpspeed += ob.gravity;
if(19 < ob.jumpspeed)
{
ob.jumpspeed = 20;
}
if(ob.jumpspeed < 0)
{
moveChar(ob,0,-1,-1);
ob.clip.gotoAndStop(4);
}
else if(0 < ob.jumpspeed)
{
moveChar(ob,0,1,1);
ob.clip.gotoAndStop(5);
}
}
function fall(ob)
{
ob.climb = false;
if(!ob.jump)
{
getMyCorners(ob.x,ob.y + 1,ob);
if(ob.downleft and ob.downright and !checkIfOnCloud(ob))
{
ob.jumpspeed = 0;
ob.jump = true;
}
}
}
function checkUpLadder(ob)
{
var downY = Math.floor((ob.y + ob.height - 1) / game.tileH);
var upY = Math.floor((ob.y - ob.height) / game.tileH);
var upLadder = game["t_" + upY + "_" + ob.xtile].ladder;
var downLadder = game["t_" + downY + "_" + ob.xtile].ladder;
if(upLadder or downLadder)
{
return true;
}
fall(ob);
}
function checkDownLadder(ob)
{
var downY = Math.floor((ob.speed + ob.y + ob.height) / game.tileH);
var downLadder = game["t_" + downY + "_" + ob.xtile].ladder;
if(downLadder)
{
return true;
}
fall(ob);
}
function climb(ob, diry)
{
ob.climb = true;
ob.jump = false;
ob.y += ob.speed * diry;
ob.x = ob.xtile * game.tileW + game.tileW / 2;
updateChar(ob,0,diry);
return true;
}
function checkMovingTiles(y)
{
if(char.diry != -1)
{
var heroymax = char.y + char.height + y;
var heroxmax = char.x + char.width;
var heroxmin = char.x - char.width;
foundit = false;
var i = 0;
while(i < game.movingtiles.length)
{
var ob = game["movingtile" + i];
var tileymax = ob.y + ob.height;
var tileymin = ob.y - ob.height;
var tilexmax = ob.x + ob.width;
var tilexmin = ob.x - ob.width;
if(tileymin >= char.lasty + char.height)
{
if(tileymax >= heroymax and heroymax >= tileymin)
{
if(tilexmin < heroxmax and heroxmax < tilexmax)
{
char.onMovingTile = ob;
foundit = true;
break;
}
if(tilexmin < heroxmin and heroxmin < tilexmax)
{
char.onMovingTile = ob;
foundit = true;
break;
}
}
}
i++;
}
return foundit;
}
}
function moveTiles()
{
var i = 0;
while(i < game.movingtiles.length)
{
var ob = game["movingtile" + i];
getMyCorners(ob.x + ob.speed * ob.dirx,ob.y + ob.speed * ob.diry,ob);
if(ob.upY < ob.miny or ob.maxy < ob.downY)
{
ob.diry = - ob.diry;
}
if(ob.leftX < ob.minx or ob.maxx < ob.rightX)
{
ob.dirx = - ob.dirx;
}
ob.x += ob.speed * ob.dirx;
ob.y += ob.speed * ob.diry;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileH);
ob.clip._x = ob.x;
ob.clip._y = ob.y;
if(ob.diry == -1)
{
checkMovingTiles(0);
}
i++;
}
if(char.onMovingTile)
{
getMyCorners(char.x,char.y + char.onMovingTile.speed * char.onMovingTile.diry,char);
if(char.onMovingTile.diry == -1)
{
if(char.upleft and char.upright)
{
char.y = char.onMovingTile.y - char.onMovingTile.height - char.height;
}
else
{
char.y = char.ytile * game.tileH + char.height;
char.jumpspeed = 0;
char.jump = true;
char.onMovingTile = false;
}
}
if(char.onMovingTile.diry == 1)
{
if(char.downleft and char.downright)
{
char.y = char.onMovingTile.y - char.onMovingTile.height - char.height;
}
else
{
char.onMovingTile = false;
char.y = (char.ytile + 1) * game.tileH - char.height;
}
}
getMyCorners(char.x + char.onMovingTile.speed * char.onMovingTile.dirx,char.y,char);
if(char.onMovingTile.dirx == -1)
{
if(char.downleft and char.upleft)
{
char.x += char.onMovingTile.speed * char.onMovingTile.dirx;
}
else
{
char.x = char.xtile * game.tileW + char.width;
fall(char);
char.onMovingTile = false;
}
}
if(char.onMovingTile.dirx == 1)
{
if(char.upright and char.downright)
{
char.x += char.onMovingTile.speed * char.onMovingTile.dirx;
}
else
{
fall(char);
char.x = (char.xtile + 1) * game.tileW - char.width;
char.onMovingTile = false;
}
}
updateChar(char);
}
}
function detectKeys()
{
moveTiles();
var ob = _root.char;
var keyPressed = false;
if(Key.isDown(32) and !ob.jump and !ob.climb and liv != 0)
{
ob.onMovingTile = false;
ob.jump = true;
ob.jumpspeed = ob.jumpstart;
}
if(Key.isDown(39) and liv != 0)
{
riktning = 1;
ob.onMovingTile = false;
if(!ob.jump and !ob.climb)
{
ob.clip.gotoAndStop(3);
}
getMyCorners(ob.x - ob.speed,ob.y,ob);
if(!ob.climb or ob.downleft and ob.upleft and ob.upright and ob.downright)
{
keyPressed = _root.moveChar(ob,1,0);
}
}
else if(Key.isDown(37) and liv != 0)
{
riktning = 0;
ob.onMovingTile = false;
if(!ob.jump and !ob.climb)
{
ob.clip.gotoAndStop(2);
}
getMyCorners(ob.x - ob.speed,ob.y,ob);
if(!ob.climb or ob.downleft and ob.upleft and ob.upright and ob.downright)
{
keyPressed = _root.moveChar(ob,-1,0);
}
}
else if(Key.isDown(38))
{
if(!ob.jump and checkUpLadder(ob))
{
keyPressed = _root.climb(ob,-1);
ob.clip.gotoAndStop(6);
}
}
else if(Key.isDown(40))
{
if(!ob.jump and checkDownLadder(ob) and liv != 0)
{
keyPressed = _root.climb(ob,1);
ob.clip.gotoAndStop(7);
}
}
if(ob.jump)
{
keyPressed = _root.jump(ob);
}
if(!keyPressed and !ob.jump and liv != 0 and !ob.climb)
{
ob.clip.gotoAndStop(1);
}
if(!keyPressed and ob.climb)
{
ob.clip.char.stop();
}
else
{
ob.clip.char.play();
}
_root.enemyBrain();
if(liv == 0)
{
ob.clip.gotoAndStop(8);
if(_root.livtest == 0)
{
_root.gameover.play();
_root.livtest = 1;
}
}
if(_root.bana == 11)
{
_root.endscene._visible = true;
}
else
{
_root.endscene._visible = false;
}
}
getURL("FSCommand:allowscale",false);
stop();
point = new Sound(this);
point.attachSound("point");
hurt = new Sound(this);
hurt.attachSound("hurt");
_root.attachMovie("opengame","opengame",25000);
_root.attachMovie("ram","ram",20000);
_root.ram._x = 15;
_root.ram._y = 30;
_root.attachMovie("gameover","gameover",10800);
_root.gameover._x = 260;
_root.gameover._y = -160;
_root.attachMovie("endscene","endscene",-1);
_root.endscene._x = 15;
_root.endscene._y = 30;
_root.endscene._visible = false;
myMap1 = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[7,3,59,2,1,1,1,1,1,1,1,1,1,1,1,8],[4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6],[4,0,0,0,0,0,0,0,0,5,0,0,0,0,0,56],[4,1,1,1,1,1,1,1,1,4,3,0,0,0,2,8],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,5,0,0,0,0,0,0,4,0,0,11,0,0,4],[4,0,9,1,1,1,1,1,1,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,3,0,0,0,0,0,0,0,4,3,0,0,0,2,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,5,0,4,0,0,0,0,0,4],[4,1,1,1,1,1,1,10,0,4,0,0,11,0,0,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,7,10,0,0,0,0,0,4],[9,3,46,2,1,1,1,1,10,0,0,0,0,0,0,10],[0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0]];
myMap2 = [[0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4],[9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,10]];
myMap11 = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0,0,7,1,3,0,0,0,0],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,5],[4,0,0,0,0,0,0,0,0,4,1,1,1,1,1,4],[4,0,0,0,0,0,0,8,0,6,0,0,0,0,0,4],[4,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4],[4,3,0,0,0,0,0,6,0,0,0,0,0,0,0,4],[4,0,0,0,0,0,2,1,8,0,0,0,0,5,0,4],[4,0,0,0,0,0,0,0,4,0,7,0,0,9,1,4],[4,0,0,0,8,0,0,0,4,0,4,0,0,0,0,4],[4,0,0,0,6,0,0,0,6,0,6,0,0,0,0,4],[9,3,12,2,1,1,1,1,1,1,1,1,1,1,1,10],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
game = {tileW:30,tileH:30,currentMap:1,points:0};
game.Tile0 = function()
{
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile1 = function()
{
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile2 = function()
{
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile3 = function()
{
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile4 = function()
{
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile5 = function()
{
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile6 = function()
{
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile7 = function()
{
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile8 = function()
{
};
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 9;
game.Tile9 = function()
{
};
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 10;
game.Tile10 = function()
{
};
game.Tile10.prototype.walkable = false;
game.Tile10.prototype.frame = 11;
game.Tile11 = function()
{
};
game.Tile11.prototype.walkable = false;
game.Tile11.prototype.frame = 12;
game.Tile12 = function()
{
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 13;
game.Tile13 = function()
{
};
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 14;
game.Tile14 = function()
{
};
game.Tile14.prototype.walkable = false;
game.Tile14.prototype.frame = 2;
game.Tile14.prototype.ladder = true;
game.Tile14.prototype.item = "ladder";
game.Tile15 = function()
{
};
game.Tile15.prototype.walkable = true;
game.Tile15.prototype.frame = 1;
game.Tile15.prototype.ladder = true;
game.Tile15.prototype.item = "ladder";
game.Tile16 = function()
{
};
game.Tile16.prototype.walkable = true;
game.Tile16.prototype.frame = 14;
game.Tile17 = function()
{
};
game.Tile17.prototype.walkable = true;
game.Tile17.prototype.frame = 15;
game.Tile18 = function()
{
};
game.Tile18.prototype.walkable = true;
game.Tile18.prototype.frame = 16;
game.Doors = function(newmap, newcharx, newchary)
{
this.newmap = newmap;
this.newcharx = newcharx;
this.newchary = newchary;
};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 30;
game.Doors.prototype.door = true;
game.Tile30 = function()
{
};
game.Tile30.prototype = new game.Doors(3,1,2);
game.Tile31 = function()
{
};
game.Tile31.prototype = new game.Doors(2,14,2);
game.Tile32 = function()
{
};
game.Tile32.prototype = new game.Doors(3,1,14);
game.Tile33 = function()
{
};
game.Tile33.prototype = new game.Doors(2,14,14);
game.Tile34 = function()
{
};
game.Tile34.prototype = new game.Doors(3,1,8);
game.Tile35 = function()
{
};
game.Tile35.prototype = new game.Doors(2,14,8);
game.Tile36 = function()
{
};
game.Tile36.prototype = new game.Doors(4,1,2);
game.Tile37 = function()
{
};
game.Tile37.prototype = new game.Doors(5,1,15);
game.Tile38 = function()
{
};
game.Tile38.prototype = new game.Doors(4,14,15);
game.Tile39 = function()
{
};
game.Tile39.prototype = new game.Doors(6,1,15);
game.Tile40 = function()
{
};
game.Tile40.prototype = new game.Doors(9,10,15);
game.Tile41 = function()
{
};
game.Tile41.prototype = new game.Doors(3,13,2);
game.Tile42 = function()
{
};
game.Tile42.prototype = new game.Doors(5,14,15);
game.Tile43 = function()
{
};
game.Tile43.prototype = new game.Doors(7,8,15);
game.Tile44 = function()
{
};
game.Tile44.prototype = new game.Doors(7,3,15);
game.Tile45 = function()
{
};
game.Tile45.prototype = new game.Doors(7,12,15);
game.Tile46 = function()
{
};
game.Tile46.prototype = new game.Doors(2,2,2);
game.Tile47 = function()
{
};
game.Tile47.prototype = new game.Doors(1,2,15);
game.Tile48 = function()
{
};
game.Tile48.prototype = new game.Doors(6,3,2);
game.Tile49 = function()
{
};
game.Tile49.prototype = new game.Doors(6,8,2);
game.Tile50 = function()
{
};
game.Tile50.prototype = new game.Doors(6,12,2);
game.Tile51 = function()
{
};
game.Tile51.prototype = new game.Doors(8,7,15);
game.Tile52 = function()
{
};
game.Tile52.prototype = new game.Doors(7,7,2);
game.Tile53 = function()
{
};
game.Tile53.prototype = new game.Doors(9,14,3);
game.Tile54 = function()
{
};
game.Tile54.prototype = new game.Doors(8,1,3);
game.Tile55 = function()
{
};
game.Tile55.prototype = new game.Doors(1,14,3);
game.Tile56 = function()
{
};
game.Tile56.prototype = new game.Doors(9,1,3);
game.Tile57 = function()
{
};
game.Tile57.prototype = new game.Doors(10,1,13);
game.Tile58 = function()
{
};
game.Tile58.prototype = new game.Doors(6,14,13);
game.Tile59 = function()
{
};
game.Tile59.prototype = new game.Doors(11,2,15);
game.Tile12 = function()
{
};
game.Tile12.prototype.walkable = true;
game.Tile12.prototype.cloud = true;
game.Tile12.prototype.frame = 13;
myEnemies = [[0],[[4,4,3],[4,3,7],[4,6,12],[3,9,16],[3,10,16],[3,11,16],[3,12,16],[3,13,16],[3,14,16]],[[4,7,11],[4,12,15],[2,4,13],[1,1,6],[1,12,5]],[[2,3,4],[3,0,16],[3,1,16],[3,2,16],[3,3,16],[3,4,16],[3,5,16],[3,6,16],[3,7,16],[3,8,16],[3,9,16],[3,10,16],[3,11,16],[3,12,16],[3,13,16],[3,14,16]],[[4,4,8],[4,11,8],[4,7,3],[4,5,11],[4,5,15]],[[3,2,16],[3,3,16],[3,4,16],[3,5,16],[3,6,16],[3,7,16],[3,8,16],[3,9,16],[3,10,16],[3,11,16],[3,12,16],[3,13,16]],[[5,2,5],[5,13,12],[6,2,9],[5,7,12],[5,9,3],[6,5,6],[6,9,10],[6,6,2]],[[1,3,7],[1,4,6],[1,5,5],[1,6,7],[1,7,6],[1,8,5],[1,9,7],[1,10,6],[1,11,5],[1,12,7],[6,1,14],[2,4,12],[2,14,14],[6,13,12]],[[6,2,13],[6,10,13],[6,4,9],[6,14,9],[6,7,5],[6,9,5]],[[2,5,4],[2,11,4],[6,4,5],[6,12,5],[2,1,6],[2,6,6],[2,10,6]]];
game.Enemyp1 = function()
{
};
game.Enemyp1.prototype.xMove = 0;
game.Enemyp1.prototype.yMove = 1;
game.Enemyp1.prototype.speed = 2;
game.Enemyp2 = function()
{
};
game.Enemyp2.prototype.xMove = 1;
game.Enemyp2.prototype.yMove = 0;
game.Enemyp2.prototype.speed = 2;
game.Enemyp3 = function()
{
};
game.Enemyp3.prototype.xMove = 0;
game.Enemyp3.prototype.yMove = 0;
game.Enemyp3.prototype.speed = 0;
game.Enemyp4 = function()
{
};
game.Enemyp4.prototype.xMove = 1;
game.Enemyp4.prototype.yMove = 0;
game.Enemyp4.prototype.speed = 3;
game.Enemyp5 = function()
{
};
game.Enemyp5.prototype.xMove = 0;
game.Enemyp5.prototype.yMove = 1;
game.Enemyp5.prototype.speed = 5;
game.Enemyp6 = function()
{
};
game.Enemyp6.prototype.xMove = 1;
game.Enemyp6.prototype.yMove = 0;
game.Enemyp6.prototype.speed = 5;
myItems = [[0],[[1,4,5],[1,6,5],[1,8,5],[1,3,10],[1,5,10],[1,7,10],[3,12,6],[3,10,9],[3,14,9],[3,12,12]],[[1,4,2],[1,10,2],[2,13,2],[2,1,5],[2,4,13],[3,14,4],[1,1,11],[1,2,11],[3,11,13]],[[2,12,2],[2,7,13],[2,8,13],[2,13,2],[1,5,5],[3,14,8]],[[1,1,7],[2,1,9],[1,1,11],[2,3,5],[2,6,5],[2,8,5],[2,12,5],[1,3,8],[1,6,8],[1,8,8],[1,12,8],[3,3,10],[3,7,10],[3,5,2],[3,8,2]],[[1,9,3],[2,8,3],[2,10,3],[1,4,7],[1,7,7],[3,12,6],[3,1,4],[1,1,5]],[[1,1,4],[1,14,4],[2,5,10],[1,5,12],[2,14,13],[1,14,15],[1,8,12],[2,8,7],[3,8,3]],[[3,1,11],[2,3,11],[3,5,11],[3,10,11],[2,12,11],[3,14,11],[1,3,2],[1,6,2],[1,9,2],[1,12,2]],[[1,1,13],[1,8,13],[1,12,13],[1,3,11],[2,5,11],[2,7,11],[1,12,11],[2,3,9],[2,8,9],[2,14,9],[2,1,7],[3,7,7],[2,12,7],[3,2,5],[3,12,5],[3,14,5]],[[1,5,13],[1,10,13],[2,5,9],[1,6,10],[3,7,9],[3,8,9],[1,9,10],[2,10,9],[1,11,6],[2,8,3],[3,4,5]],[[2,3,3],[3,7,3],[3,8,3],[2,12,3],[3,5,6],[3,10,6],[1,4,9],[1,11,9],[1,4,8],[1,11,8],[1,3,11],[1,12,11],[1,3,12],[1,12,12],[1,7,10],[1,8,10],[2,7,11],[2,8,11]]];
game.Item1 = function()
{
};
game.Item1.prototype.points = 2;
game.Item2 = function()
{
};
game.Item2.prototype.points = 5;
game.Item3 = function()
{
};
game.Item3.prototype.points = 10;
game.Item4 = function()
{
};
game.Item4.prototype.liv = 10;
game.MovingTilep1 = function()
{
};
game.MovingTilep1.prototype.speed = 2;
game.MovingTilep1.prototype.dirx = 1;
game.MovingTilep1.prototype.diry = 0;
game.MovingTilep1.prototype.minx = 0;
game.MovingTilep1.prototype.maxx = 7;
game.MovingTilep1.prototype.width = game.tileW / 2;
game.MovingTilep1.prototype.height = game.tileH / 2;
game.MovingTilep2 = function()
{
};
game.MovingTilep2.prototype.speed = 2;
game.MovingTilep2.prototype.dirx = 1;
game.MovingTilep2.prototype.diry = 0;
game.MovingTilep2.prototype.minx = -5;
game.MovingTilep2.prototype.maxx = 4;
game.MovingTilep2.prototype.width = game.tileW / 2;
game.MovingTilep2.prototype.height = game.tileH / 2;
game.MovingTilep3 = function()
{
};
game.MovingTilep3.prototype.speed = 2;
game.MovingTilep3.prototype.dirx = -1;
game.MovingTilep3.prototype.diry = 0;
game.MovingTilep3.prototype.minx = -2;
game.MovingTilep3.prototype.maxx = 3;
game.MovingTilep3.prototype.width = game.tileW / 2;
game.MovingTilep3.prototype.height = game.tileH / 2;
game.MovingTilep4 = function()
{
};
game.MovingTilep4.prototype.speed = 2;
game.MovingTilep4.prototype.dirx = 0;
game.MovingTilep4.prototype.diry = -1;
game.MovingTilep4.prototype.miny = -2;
game.MovingTilep4.prototype.maxy = 2;
game.MovingTilep4.prototype.width = game.tileW / 2;
game.MovingTilep4.prototype.height = game.tileH / 2;
game.MovingTilep5 = function()
{
};
game.MovingTilep5.prototype.speed = 2;
game.MovingTilep5.prototype.dirx = 1;
game.MovingTilep5.prototype.diry = 0;
game.MovingTilep5.prototype.minx = -2;
game.MovingTilep5.prototype.maxx = 1;
game.MovingTilep5.prototype.width = game.tileW / 2;
game.MovingTilep5.prototype.height = game.tileH / 2;
game.MovingTilep6 = function()
{
};
game.MovingTilep6.prototype.speed = 2;
game.MovingTilep6.prototype.dirx = 0;
game.MovingTilep6.prototype.diry = 1;
game.MovingTilep6.prototype.miny = -2;
game.MovingTilep6.prototype.maxy = 0;
game.MovingTilep6.prototype.width = game.tileW / 2;
game.MovingTilep6.prototype.height = game.tileH / 2;
myMovingTiles = [[],[],[],[[2,8,15]],[],[[3,5,10],[5,11,10],[4,2,12],[4,13,12]],[],[],[],[[1,4,11]]];
char = {xtile:2,ytile:5,speed:4,jumpstart:-21,gravity:2,jump:false,climb:false};
buildMap(_root["myMap" + game.currentMap]);
fall(_root.char);
stop();